import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import svgIcon from './components/svg-icon.vue'
import 'virtual:svg-icons-register'

import { checkProverbTable, initData } from './utils/db'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.component('svg-icon', svgIcon)

app.mount('#app')
;(async () => {
  if (!(await checkProverbTable())) {
    await initData()
  }
})()
